#define _CRT_SECURE_NO_WARNINGS 1

#include "Heap.h"

void HeapTest1()
{
	HP hp;
	HeapInit(&hp);

	int a[] = { 21, 32, 43, 72, 56, 96 };
	int sz = sizeof(a) / sizeof(a[0]);

	for (int i = 0; i < sz; i++)
	{
		HeapPush(&hp, a[i]);
	}
	HeapPrint(&hp);

	HeapPop(&hp);
	HeapPrint(&hp);

	HeapPop(&hp);
	HeapPrint(&hp);

	HeapPop(&hp);
	HeapPrint(&hp);

	HeapPop(&hp);
	HeapPrint(&hp);

	HeapPop(&hp);
	HeapPrint(&hp);

	HeapPop(&hp);
	HeapPrint(&hp);

	HeapDestroy(&hp);
}

void HeapTest2()
{
	HP hp;
	HeapInit(&hp);
	bool ret1 = HeapEmpty(&hp);
	if (ret1 == true)
		printf("Empty\n");
	else
		printf("noEmpty\n");

	int a[] = { 21, 32, 43, 72, 56, 96 };
	int sz = sizeof(a) / sizeof(a[0]);
	for (int i = 0; i < sz; i++)
	{
		HeapPush(&hp, a[i]);
	}

	printf("size = %d\n", HeapSize(&hp));

	bool ret2 = HeapEmpty(&hp);
	if (ret2 == true)
		printf("Empty\n");
	else
		printf("noEmpty\n");

	HeapDestroy(&hp);
}


int main()
{
	//HeapTest1();
	HeapTest2();
	return 0;
}